package com.me.experiment;


import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
 
public class Email extends Activity {
        Button send;
        EditText address, subject, emailtext;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.mail);
        send=(Button) findViewById(R.id.emailsendbutton);
        send.setOnClickListener(new OnClickListener() {
                       
                        public void onClick(View v) {
                                // TODO Auto-generated method stub
                                 
                                      final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
                               
                                      emailIntent.setType("plain/text");                           
                                      emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,   new String[]{"vincent.adam87@gmail.com"});                              
                                      emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Data from experiment"); 
                                      emailIntent.putExtra(android.content.Intent.EXTRA_STREAM,Uri.parse("file:///sdcard/Experiment/data.txt"));
                                      Email.this.startActivity(Intent.createChooser(emailIntent, "Send mail..."));
 
                        }
                });
    }
}